package l.l.w.practice.校招全国统一模拟笔试第五场编程题集合2017年.DNA片段;

import java.util.Scanner;

/**
 * Created by llw on 2017/10/12.
 */
public class DNA片段 {
    char[] dna = {'A','T','C','G'};
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int result = new DNA片段().getMaxDNALength(str);
        System.out.println(result);
    }

    public int getMaxDNALength(String str) {
        int start=0;int end =0;int maxLen = 0;int len = 0;
        for(int i = 0; i < str.length(); ++i){
            switch (str.charAt(i)){
                case 'A':;
                case 'C':;
                case 'G':;
                case 'T':{
                    end++;
                    len = end - start;
                    if(len > maxLen)
                        maxLen = len;
                    break;
                }
                default: {
                    start = i+1;
                    end = start;
                    break;
                }

            }
        }
        return maxLen;
    }
}
